<?php
namespace app\common\model\mysql;

use think\Model;
class AdminUser extends Model
{
    public function getAdminUserByUsername($username){
        if(empty($username)){
            return false;
        }
        $where = [
            'username' => trim($username),
        ];
        $result = $this->where($where)->find();
        return $result;
    }

    //修改用户信息
    /**
        * 根据id获取用户信息
     */
    public function updateById($id,$data = []){
        if(empty($id) || empty($data) || !is_array($data)){
            return false;
        }
        $where = [
            'id' => $id,
        ];
        return $this->where($where)->save($data);
    }
}